package org.ccay.manage.hypertext.service.impl;

import java.util.Map;

import javax.inject.Named;

import org.ccay.core.exception.ApplicationException;
import org.ccay.core.io.FileStoreType;
import org.ccay.core.io.VFSFileObject;
import org.ccay.download.IDownloadSupport;
import org.ccay.vfs.ApacheVFSFileObject;


/**
 * 图片下载的支持	
 * @author chaowangbang
 * @since 2012-2-14
 */
@Named("IDownloadSupport.hyperTextImage")
public class ImageDownloadSupport implements IDownloadSupport {

	@Override
	public boolean validatePrivilege(Map<String, String> map) throws ApplicationException {
		return true;
	}

	@Override
	public VFSFileObject getFileInfo(Map<String, String> map) throws ApplicationException {
		String reletivePath = map.get("path");
		ApacheVFSFileObject fileObject =  new ApacheVFSFileObject("hyperTextImage",reletivePath,FileStoreType.ARCHIVE);
		return fileObject;
	}

}
